TaskCompletionSource(TResult) Constructor (Object, TaskCreationOptions)

Task Parallel System.Threading

Creates a TaskCompletionSource<(Of <(TResult>)>) with the specified state and options.

Namespace:  System.Threading.Tasks
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Sub New ( _
	state As Object, _
	creationOptions As TaskCreationOptions _
)
C#
public TaskCompletionSource(
	Object state,
	TaskCreationOptions creationOptions
)

Parameters

state
Type: System..::.Object
The state to use as the underlying Task<(Of <(TResult>)>)'s AsyncState.
creationOptions
Type: System.Threading.Tasks..::.TaskCreationOptions
The options to use when creating the underlying Task<(Of <(TResult>)>).

Exceptions

ExceptionCondition
System..::.ArgumentOutOfRangeException The creationOptions represent options invalid for use with a TaskCompletionSource<(Of <(TResult>)>).

See Also